﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Game
{
    public abstract class GameObjectMoveableInfo : GameObjectInfo
    {
        public override void RemoveInstance(GameObject obj, WorldScene scene)
        {
            var instance = obj as GameObjectMoveable;

            scene.DeleteBody(instance.Body);
        }
    }

    public abstract class GameObjectMoveable : GameObject
    {
        public Body Body
        {
            get;
            set;
        }

        public override void UpdateInfo()
        {
        }

        public override void Invalidate()
        {
            Body.SetPosition(Body.SceneNode.GetTransformation().GetWorldPosition());
        }

        public override void OnUpdate(Events.ProcessSceneUpdate evnt)
        {
            Body.OnUpdate(evnt);
        }
    }
}
